# 设置 redis 密码
echo "Setting Redis password..."
sed -i 's/^# requirepass .*/requirepass xxx/' /etc/redis.conf
grep -q "^requirepass" /etc/redis.conf || echo "requirepass xxx" >> /etc/redis.conf

# 重启 redis 生效
systemctl restart redis